package org.jeecg.modules.ParameterModule.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.ParameterModule.entity.*;
import org.jeecg.modules.ParameterModule.mapper.FormalCategoryInfoMapper;
import org.jeecg.modules.ParameterModule.mapper.FormalPlateInfoMapper;
import org.jeecg.modules.ParameterModule.mapper.TestPlateInfoMapper;
import org.jeecg.modules.ParameterModule.service.FormalCategoryInfoService;
import org.jeecg.modules.ParameterModule.service.TestPlateInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;

import java.util.List;

@Service
public class TestPlateInfoServiceImpl extends ServiceImpl<TestPlateInfoMapper, CountDataInfo> implements TestPlateInfoService {
    @Autowired
    private TestPlateInfoMapper logicMapper;

    /**测试版号列表*/
    @Override
    public IPage<MlccCategoryTestInfo> query_testCategoryPageList(Page<MlccCategoryTestInfo> page, String queryName, String queryCode,String pingleiName) {
        IPage<MlccCategoryTestInfo> pagelist = logicMapper.query_testCategoryPageList(page,queryName,queryCode,pingleiName);
        return pagelist;
    }
    //查询所有的品类列表
    @Override
    public List<MlccCategoryInfo> query_allpinglei_list() {
        List<MlccCategoryInfo> datalist = logicMapper.query_allpinglei_list();
        return datalist;
    }
    //根据id查询正式的类别详情
    @Override
    public MlccCategoryInfo queryCategoryDetailById(String categoryId) {
        MlccCategoryInfo datalist = logicMapper.queryCategoryDetailById(categoryId);
        return datalist;
    }
    //根据编号和类型查询测试的类别
    @Override
    public MlccCategoryTestInfo queryCategoryDetailBytype(String code,int type) {
        MlccCategoryTestInfo datalist = logicMapper.queryCategoryDetailBytype(code,type);
        return datalist;
    }

    /**根据品类id查询定制项*/
    @Override
    public List<SmalltemplateTestInfo> query_dingzhiBycategoryId(String category_id) {
        List<SmalltemplateTestInfo> datalist = logicMapper.query_dingzhiBycategoryId(category_id);
        return datalist;
    }
    /**根据品类id查询参数*/
    @Override
    public List<MlccCategoryTestInfo> query_AllcanshuBypingleiId(String category_id) {
        List<MlccCategoryTestInfo> datalist = logicMapper.query_AllcanshuBypingleiId(category_id);
        return datalist;
    }
    /**根据品类id查询所有互斥*/
    @Override
    public List<MutexTestInfo> query_AllhuchiBypingleiId(String category_id) {
        List<MutexTestInfo> datalist = logicMapper.query_AllhuchiBypingleiId(category_id);
        return datalist;
    }
    /** //根据品类id查询绣字部位*/
    @Override
    public List<CategoryLocationTestInfo> query_Allxiuzi1BypingleiId(String category_id) {
        List<CategoryLocationTestInfo> datalist = logicMapper.query_Allxiuzi1BypingleiId(category_id);
        return datalist;
    }
    /**根据品类id查询所有绣字颜色*/
    @Override
    public List<EmbroideredColorTestInfo> query_AllxiuziColorBypingleiId(String category_id) {
        List<EmbroideredColorTestInfo> datalist = logicMapper.query_AllxiuziColorBypingleiId(category_id);
        return datalist;
    }

    @Override
    public List<EmbroideredFontTestInfo> query_AllxiuziFontBypingleiId(String category_id) {
        List<EmbroideredFontTestInfo> datalist = logicMapper.query_AllxiuziFontBypingleiId(category_id);
        return datalist;
    }

    @Override
    public List<ContrastcolorTestInfo> query_AllzhuangseBypingleiId(String category_id) {
        List<ContrastcolorTestInfo> datalist = logicMapper.query_AllzhuangseBypingleiId(category_id);
        return datalist;
    }

    @Override
    public List<BodySizeTestInfo> query_AlljingtiBodysizeBypingleiId(String category_id) {
        List<BodySizeTestInfo> datalist = logicMapper.query_AlljingtiBodysizeBypingleiId(category_id);
        return datalist;
    }

    @Override
    public List<CategoryFanxiuTestInfo> query_AllFanxiuBypingleiId(String category_id) {
        List<CategoryFanxiuTestInfo> datalist = logicMapper.query_AllFanxiuBypingleiId(category_id);
        return datalist;
    }

    @Override
    public List<MlccCategoryTestInfo> query_AllGongyiBypingleiId(String category_id) {
        List<MlccCategoryTestInfo> datalist = logicMapper.query_AllGongyiBypingleiId(category_id);
        return datalist;
    }

    @Override
    public List<AddSystemPriceInfo> query_AllsyspriceBypingleiId(String category_id,int type) {
        List<AddSystemPriceInfo> datalist = logicMapper.query_AllsyspriceBypingleiId(category_id,type);
        return datalist;
    }

    @Override
    public List<CategoryMaterialInfo> query_AllfuliaoBypingleiId2(String category_id) {
        List<CategoryMaterialInfo> datalist = logicMapper.query_AllfuliaoBypingleiId2(category_id);
        return datalist;
    }

    /**统计数据*/
    @Override
    public int count_dingzhi(String category_id) {
        return logicMapper.count_dingzhi(category_id);
    }
    @Override
    public int count_huchi(String category_id) {
        return logicMapper.count_huchi(category_id);
    }
    @Override
    public int count_xiuzi(String category_id) {
        return logicMapper.count_xiuzi(category_id);
    }
    @Override
    public int count_zhuangse(String category_id) {
        return logicMapper.count_zhuangse(category_id);
    }
    @Override
    public int count_jing_bodysize(String category_id) {
        return logicMapper.count_jing_bodysize(category_id);
    }
    @Override
    public int count_cheng_bodysize(String category_id) {
        return logicMapper.count_cheng_bodysize(category_id);
    }
    @Override
    public int count_fanxiu(String category_id) {
        return logicMapper.count_fanxiu(category_id);
    }
    @Override
    public int count_gongyi(String category_id) {
        return logicMapper.count_gongyi(category_id);
    }
    @Override
    public int count_xiuzi_color(String category_id) {
        return logicMapper.count_xiuzi_color(category_id);
    }
    @Override
    public int count_xiuzi_font(String category_id) {
        return logicMapper.count_xiuzi_font(category_id);
    }
    @Override
    public int count_xiuzi_img(String category_id) {
        return logicMapper.count_xiuzi_img(category_id);
    }

    @Override
    public int count_fuliao(String category_id) {
        return logicMapper.count_fuliao(category_id);
    }

    @Override
    public int count_standardcode(String category_id) {
        return logicMapper.count_standardcode(category_id);
    }

    /**新增版号*/
    @Override
    public int add_category_plate(MlccCategoryTestInfo testinfo) {
        try {
            logicMapper.add_category_plate(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("新增失败"+e.toString());
            return 0;
        }
    }
    /**新增定制项*/
    @Override
    public int add_dingzhi(SmalltemplateTestInfo dingzhi) {
        try {
            logicMapper.add_dingzhi(dingzhi);
            return 1;
        }catch (Exception e){
            System.out.print("新增失败"+e.toString());
            return 0;
        }
    }
    /**添加定制下的参数*/
    @Override
    public int add_dingzhi_canshu(MlccCategoryTestInfo dingzhi) {
        try {
            logicMapper.add_dingzhi_canshu(dingzhi);
            return 1;
        }catch (Exception e){
            System.out.print("添加失败"+e.toString());
            return 0;
        }
    }
    /**新增互斥项列表*/
    @Override
    public int add_huchi(MutexTestInfo mutexTestInfo) {
        try {
            logicMapper.add_huchi(mutexTestInfo);
            return 1;
        }catch (Exception e){
            System.out.print("新增失败"+e.toString());
            return 0;
        }
    }
    /**添加-绣字位置*/
    @Override
    public int add_xiuzi_location(CategoryLocationTestInfo testinfo) {
        try {
            logicMapper.add_xiuzi_location(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }
    /**添加-绣字颜色*/
    @Override
    public int add_xiuzi_color(EmbroideredColorTestInfo testinfo) {
        try {
            logicMapper.add_xiuzi_color(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("添加失败"+e.toString());
            return 0;
        }
    }
    /**添加-绣字字体图片*/
    @Override
    public int add_xiuzi_fontImg(EmbroideredFontTestInfo testinfo) {
        try {
            logicMapper.add_xiuzi_fontImg(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }
    /**新增绣字-字体图片-大小价格*/
    @Override
    public int add_xiuzi_fontImgSize(EmbroideredFontTestInfo testinfo) {
        try {
            logicMapper.add_xiuzi_fontImgSize(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }
    /**添加撞色列表*/
    @Override
    public int add_zhuangse(ContrastcolorTestInfo testinfo) {
        try {
            logicMapper.add_zhuangse(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int add_testbodySize(BodySizeTestInfo testinfo) {
        try {
            logicMapper.add_testbodySize(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int add_testFanxiuSize(CategoryFanxiuTestInfo testinfo) {
        try {
            logicMapper.add_testFanxiuSize(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_dingzhi(SmalltemplateTestInfo dingzhi) {
        try {
            logicMapper.update_dingzhi(dingzhi);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_dingzhi_canshu(MlccCategoryTestInfo dingzhi) {
        try {
            logicMapper.update_dingzhi_canshu(dingzhi);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_huchi(MutexTestInfo mutexTestInfo) {
        try {
            logicMapper.update_huchi(mutexTestInfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_xiuzi_location(CategoryLocationTestInfo testinfo) {
        try {
            logicMapper.update_xiuzi_location(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_xiuzi_color(EmbroideredColorTestInfo testinfo) {
        try {
            logicMapper.update_xiuzi_color(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_xiuzi_fontImg(EmbroideredFontTestInfo testinfo) {
        try {
            logicMapper.update_xiuzi_fontImg(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_xiuzi_fontImgSize(EmbroideredFontTestInfo testinfo) {
        try {
            logicMapper.update_xiuzi_fontImgSize(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_zhuangse(ContrastcolorTestInfo testinfo) {
        try {
            logicMapper.update_zhuangse(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_testbodySize(BodySizeTestInfo testinfo) {
        try {
            logicMapper.update_testbodySize(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int update_testFanxiuSize(CategoryFanxiuTestInfo testinfo) {
        try {
            logicMapper.update_testFanxiuSize(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("更新失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_dingzhi(String dingzhi_id) {
        try {
            logicMapper.delete_dingzhi(dingzhi_id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_dingzhi_canshu(String canshu_id) {
        try {
            logicMapper.delete_dingzhi_canshu(canshu_id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_huchi(String huchi_id) {
        try {
            logicMapper.delete_huchi(huchi_id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_xiuzi_location(String id) {
        try {
            logicMapper.delete_xiuzi_location(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_xiuzi_color(String id) {
        try {
            logicMapper.delete_xiuzi_color(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_xiuzi_fontImg(String id) {
        try {
            logicMapper.delete_xiuzi_fontImg(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_zhuangse(String id) {
        try {
            logicMapper.delete_zhuangse(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_testbodySize(String id) {
        try {
            logicMapper.delete_testbodySize(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int delete_testfanxiuSize(String id) {
        try {
            logicMapper.delete_testfanxiuSize(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int delete_testcategory(String id) {
        try {
            logicMapper.delete_testcategory(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }
    /**编辑版号*/
    @Override
    public int update_category_plate(MlccCategoryTestInfo testinfo) {
        try {
            logicMapper.update_category_plate(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("编辑失败"+e.toString());
            return 0;
        }
    }
    /**根据测试版号id查询最新添加的定制项*/
    @Override
    public List<SmalltemplateTestInfo> query_testdingzhiByBanhaoId(String banhao_id) {
        List<SmalltemplateTestInfo> datalist = logicMapper.query_testdingzhiByBanhaoId(banhao_id);
        return datalist;
    }

    @Override
    public List<EmbroidedHeightInfo> query_AllHeightBypingleiId(String category_id) {
        List<EmbroidedHeightInfo> datalist = logicMapper.query_AllHeightBypingleiId(category_id);
        return datalist;
    }

    @Override
    public int add_xiuzi_height(EmbroidedHeightInfo testinfo) {
        try {
            logicMapper.add_xiuzi_height(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("编辑失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_xiuzi_height(String id) {
        try {
            logicMapper.delete_xiuzi_height(id);
            return 1;
        }catch (Exception e){
            System.out.print("编辑失败"+e.toString());
            return 0;
        }
    }
    /**根据条件修改类别状态*/
    @Override
    public int update_category_status(String type, String status, String category_id) {
        try {
            logicMapper.update_category_status(type,status,category_id);
            return 1;
        }catch (Exception e){
            System.out.print("编辑失败"+e.toString());
            return 0;
        }
    }
    //根据类别id和是否是品类、是否是启用查询
    @Override
    public List<QiyongListInfo> query_UpdatecategoryRecord(String category_id, String is_ping, String is_qiyong) {
        List<QiyongListInfo> datalist = logicMapper.query_UpdatecategoryRecord(category_id,is_ping,is_qiyong);
        return datalist;
    }
    //根据版号id查询所有定制项列表
    @Override
    public List<SmalltemplateTestInfo> query_alldingzhiByplateId(String category_id) {
        List<SmalltemplateTestInfo> datalist = logicMapper.query_alldingzhiByplateId(category_id);
        return datalist;
    }

    //定制项下的所有参数
    @Override
    public IPage<MlccCategoryTestInfo> query_testCanshuPageList(Page<MlccCategoryTestInfo> page, String topcategory_id, String module_id, String queryName) {
        IPage<MlccCategoryTestInfo> pagelist = logicMapper.query_testCanshuPageList(page,topcategory_id,module_id,queryName);
        return pagelist;
    }
    //定制项下的所有参数
    @Override
    public int change_dingzhi_status(String type, String status, String id) {
        try {
            logicMapper.change_dingzhi_status(type,status,id);
            return 1;
        }catch (Exception e){
            System.out.print("编辑失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int change_dingzhi_canshu_status(String type, String status, String id) {
        try {
            logicMapper.change_dingzhi_canshu_status(type,status,id);
            return 1;
        }catch (Exception e){
            System.out.print("编辑失败"+e.toString());
            return 0;
        }
    }

    //根据类别id查询版号详情
    @Override
    public MlccCategoryTestInfo query_plateDetailById(String categoryId) {
        MlccCategoryTestInfo datainfo = logicMapper.query_plateDetailById(categoryId);
        return datainfo;
    }
    //根据类型和类别id查询启用记录
    @Override
    public QiyongListInfo query_qiyongRecord_categotyId(String is_ping, String category_id) {
        QiyongListInfo datainfo = logicMapper.query_qiyongRecord_categotyId(is_ping,category_id);
        return datainfo;
    }

    /**版号下的里布列表*/
    @Override
    public IPage<CategoryMaterialInfo> query_material_libuPageList(Page<CategoryMaterialInfo> page, String category_id, String queryName, String queryCode) {
        IPage<CategoryMaterialInfo> pagelist = logicMapper.query_material_libuPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }
    /**版号下的低领里列表*/
    @Override
    public IPage<CategoryMaterialInfo> query_material_dilingliPageList(Page<CategoryMaterialInfo> page, String category_id, String queryName, String queryCode) {
        IPage<CategoryMaterialInfo> pagelist = logicMapper.query_material_dilingliPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }
    /**版号下的纽扣列表*/
    @Override
    public IPage<CategoryMaterialInfo> query_material_buttonsPageList(Page<CategoryMaterialInfo> page, String category_id, String queryName, String queryCode) {
        IPage<CategoryMaterialInfo> pagelist = logicMapper.query_material_buttonsPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }
    @Override
    public int add_plate_libu(CategoryMaterialInfo testinfo) {
        try {
            logicMapper.add_plate_libu(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("新增失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int delete_plate_libu(String id) {
        try {
            logicMapper.delete_plate_libu(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    /**测试绣字部位列表*/
    @Override
    public IPage<CategoryLocationTestInfo> query_testlocaltionPageList(Page<CategoryLocationTestInfo> page,String category_id, String queryName, String queryCode) {
        IPage<CategoryLocationTestInfo> pagelist = logicMapper.query_testlocaltionPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }
    /**测试绣字颜色列表*/
    @Override
    public IPage<EmbroideredColorTestInfo> query_testColorPageList(Page<EmbroideredColorTestInfo> page,String category_id, String queryName, String queryCode) {
        IPage<EmbroideredColorTestInfo> pagelist = logicMapper.query_testColorPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }
    /**测试绣字图片列表*/
    @Override
    public IPage<EmbroideredFontTestInfo> query_testImgPageList(Page<EmbroideredFontTestInfo> page,String category_id, String queryName, String queryCode) {
        IPage<EmbroideredFontTestInfo> pagelist = logicMapper.query_testImgPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }
    /**测试绣字字体列表*/
    @Override
    public IPage<EmbroideredFontTestInfo> query_testFontPageList(Page<EmbroideredFontTestInfo> page, String category_id,String queryName, String queryCode) {
        IPage<EmbroideredFontTestInfo> pagelist = logicMapper.query_testFontPageList(page,category_id,queryName,queryCode);
        return pagelist;
    }

    @Override
    public int delete_real_dingzhi(String top_id) {
        try {
            logicMapper.delete_real_dingzhi(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_dingzhi_canshu(String top_id) {
        try {
            logicMapper.delete_real_dingzhi_canshu(top_id,"","");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_xiuzi_location(String top_id) {
        try {
            logicMapper.delete_real_xiuzi_location(top_id,"11");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_xiuzi_color(String top_id) {
        try {
            logicMapper.delete_real_xiuzi_color(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_xiuzi_fontImg(String top_id) {
        try {
            logicMapper.delete_real_xiuzi_fontImg(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_huchi(String top_id) {
        try {
            logicMapper.delete_real_huchi(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_zhuahngse(String top_id) {
        try {
            logicMapper.delete_real_zhuahngse(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_size(String top_id) {
        try {
            logicMapper.delete_real_size(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_fanxiusize(String top_id) {
        try {
            logicMapper.delete_real_fanxiusize(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_real_gongyi(String top_id) {
        try {
            logicMapper.delete_real_gongyi(top_id,"");
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public List<AddSystemPriceInfo> query_AllAddSystemPriceBypingleiId(String category_id, int type) {
        List<AddSystemPriceInfo> datalist = logicMapper.query_AllAddSystemPriceBypingleiId(category_id,type);
        return datalist;
    }

    @Override
    public MlccCategoryInfo select_zscategoryDetailByother(String category_code, String zs_pingleiId, String dingzhi_id) {
        MlccCategoryInfo datainfo = logicMapper.select_zscategoryDetailByother(category_code,zs_pingleiId,dingzhi_id);
        return datainfo;
    }

    /**执行查询所有参数根据版号id，定制项id*/
    @Override
    public List<MlccCategoryTestInfo> query_AllcanshuByplate_dingzhiId(String category_id, String dingzhi_id) {
        List<MlccCategoryTestInfo> datalist = logicMapper.query_AllcanshuByplate_dingzhiId(category_id,dingzhi_id);
        return datalist;
    }

    /**标准码尺寸表--分页--type:1正式，2测试*/
    @Override
    public IPage<StandardCodeInfo> query_standardCode_pagelist(Page<StandardCodeInfo> page, String category_id, String queryName, String queryTime, String type) {
        IPage<StandardCodeInfo> pagelist = logicMapper.query_standardCode_pagelist(page,category_id,queryName,queryTime,type);
        return pagelist;
    }
    @Override
    public List<StandardCodeInfo> query_standardCodelist(String category_id, int type) {
        List<StandardCodeInfo> datalist = logicMapper.query_standardCodelist(category_id,type);
        return datalist;
    }
    @Override
    public StandardCodeInfo query_standardCodeDetail(String id, int type) {
        StandardCodeInfo datainfo = logicMapper.query_standardCodeDetail(id,type);
        return datainfo;
    }
    @Override
    public int add_StandardCode(StandardCodeInfo testinfo) {
        try {
            logicMapper.add_StandardCode(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int update_StandardCode(StandardCodeInfo testinfo) {
        try {
            logicMapper.update_StandardCode(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }
    @Override
    public int delete_StandardCode(String id) {
        try {
            logicMapper.delete_StandardCode(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int add_StandardCode_zhengshi(StandardCodeInfo testinfo) {
        try {
            logicMapper.add_StandardCode_zhengshi(testinfo);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public int delete_StandardCode_zhengshi(String id) {
        try {
            logicMapper.delete_StandardCode_zhengshi(id);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }
    /**修改撞色的状态：1撞色，2尺寸，3返修，4工艺类型*/
    @Override
    public int change_parameter_status(String id, String status, int type) {
        try {
            logicMapper.change_parameter_status(id,status,type);
            return 1;
        }catch (Exception e){
            System.out.print("删除失败"+e.toString());
            return 0;
        }
    }

    @Override
    public IPage<ContrastcolorTestInfo> query_testzhuangsePageList(Page<ContrastcolorTestInfo> page, String category_id, String queryName, String queryTime) {
        IPage<ContrastcolorTestInfo> pagelist = logicMapper.query_testzhuangsePageList(page,category_id,queryName,queryTime);
        return pagelist;
    }

    @Override
    public IPage<BodySizeTestInfo> query_testBodySizePageList(Page<BodySizeTestInfo> page, String type, String category_id, String queryName, String queryTime) {
        IPage<BodySizeTestInfo> pagelist = logicMapper.query_testBodySizePageList(page,type,category_id,queryName,queryTime);
        return pagelist;
    }

    @Override
    public IPage<CategoryFanxiuTestInfo> query_testFanxiuSizePageList(Page<CategoryFanxiuTestInfo> page, String category_id, String queryName, String queryTime) {
        IPage<CategoryFanxiuTestInfo> pagelist = logicMapper.query_testFanxiuSizePageList(page,category_id,queryName,queryTime);
        return pagelist;
    }

    @Override
    public IPage<MlccCategoryTestInfo> query_testCategoryPageListBytype(Page<MlccCategoryTestInfo> page, String category_id, String type, String queryName, String queryCode) {
        IPage<MlccCategoryTestInfo> pagelist = logicMapper.query_testCategoryPageListBytype(page,category_id,type,queryName,queryCode);
        return pagelist;
    }

    /**批量删除辅料*/
    @Override
    public int delete_batch_material(List<Integer> ids) {
        try {
            if(ids.size()>0){
                //循环删除
                for (int i=0;i<ids.size();i++){
                    logicMapper.delete_plate_libu(ids.get(i).toString());
                }
                return 1;
            }else {
                return 2;
            }
        }catch (Exception e){
            //手动回滚事务
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return 0;
        }
    }
    /**
     * 一键删除辅料根据类型
     * @param type:0里布，1低领里，2钮扣
     * */
    @Override
    public int real_delete_material(String category_id, String type) {
        try {
            logicMapper.real_delete_material(category_id,type);
            return 1;
        }catch (Exception e){
            //手动回滚事务
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return 0;
        }
    }

    @Override
    public StandardCodeInfo query_standardCodeDetailBycode(String code) {
        StandardCodeInfo datainfo = logicMapper.query_standardCodeDetailBycode(code);
        return datainfo;
    }

    /**批量删除标准码*/
    @Override
    public int delete_batch_standardCode(List<String> ids) {
        try {
            if(ids.size()>0){
                //循环删除
                for (int i=0;i<ids.size();i++){
                    logicMapper.real_delete_standardCode(ids.get(i));
                }
                return 1;
            }else {
                return 2;
            }
        }catch (Exception e){
            //手动回滚事务
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return 0;
        }
    }

    @Override
    public int real_delete_standardCode(String id) {
        try {
            logicMapper.real_delete_standardCode(id);
            return 1;
        }catch (Exception e){
            return 0;
        }
    }

}
